package cn.lg.soar.cloud.core.feign;

import cn.lg.soar.cloud.core.feign.fallback.OperationLogApiFallbackFactory;
import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.database.datascope.Filter;
import cn.lg.soar.database.datascope.IDataPermissionService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2024/2/27 20:15
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@RefreshScope
@ConditionalOnMissingClass("cn.lg.soar.system.auth.client.DataPermissionApiClient")
@ApiClient
@FeignClient(name="system", path= "client/datapermission", contextId="DataPermissionApiFeign")
public interface DataPermissionApiFeign extends IDataPermissionService {

    @GetMapping("mapId")
    @Override
    Long mapId(@RequestParam("resource") String resource);

    @GetMapping("dataScopes")
    @Override
    List<List<Filter>> dataScopes(@RequestParam("resourceId") Long resourceId);

}
